<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<input type="text">
<script src="./axios.js"></script>
<script>
let input = document.getElementsByTagName('input')[0]

axios.defaults.baseURL = 'http://localhost:3000' //设置默认

axios.get('/user?id=1234').then(data=>{
    input.value = data.data
}).catch(err => {
    console.log(err)
}).then(() => {
    console.log('always executed');
})

// axios.get('/a',{
//     params:{
//         id:"gailun",
//     },
// }).then()
</script>
</body>
</html>